<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container {
        /* border: 1px solid red; */
        overflow: auto; /* 创建 BFC */
    }
    .float {
        float: left;
        width: 100px;
        height: 100px;
        background-color: blue;
        margin-right: 20px;
    }
    .box {
        width: 200px;
        height: 200px;
        background-color: yellow;
        margin: 20px;
        overflow: hidden 
    }
</style>


</head>
<!-- 同⼀个 BFC 下的相邻块级元素可能发⽣margin折叠，创建新的 BFC 可以避免的外边距折叠 -->
<body>
  <div class="container">
    <div class="float"></div>
    <div class="box"></div>
    <div class="box"></div>
</div>


</body>
</html>